package my.example.samplegridview.modal;

import android.content.Context;
import android.database.Cursor;
import android.net.Uri;

public class product_option_value {
	public static final String Table = "o2s_product_option_value";
    public static final Uri    CONTENT_URI = Uri.parse("content://o2s.contentprovider.datacontentprovider/product_option_value");
    public static final String SQLCREATE = "CREATE TABLE o2s_product_option_value ( " +
    										"product_option_value_id INTEGER PRIMARY KEY , " +
    										"product_option_id int(11) , " +
    										"product_id int(11) , " +
    										"quantity int(4)  DEFAULT '0', " +
    										"subtract int(1)  DEFAULT '0', " +
    										"price decimal(15,4) , " +
    										"prefix char(1) , " +
    										"sort_order int(3) );";
    
    private String product_option_value_id;
    private String product_option_id;
    private String product_id;
    private String quantity;
    private String subtract;
    private String price;
    private String prefix;
    private String sort_order;
    
    private Context mContext;
    private product_option_value_description prooptionvaluedescription;
    
    public product_option_value(Context mContext){
    	prooptionvaluedescription = new product_option_value_description();
    	this.mContext = mContext;
    }
    
	public String getProduct_option_value_id() {
		return product_option_value_id;
	}
	public void setProduct_option_value_id(String product_option_value_id) {
		this.product_option_value_id = product_option_value_id;
	}
	public String getProduct_option_id() {
		return product_option_id;
	}
	public void setProduct_option_id(String product_option_id) {
		this.product_option_id = product_option_id;
	}
	public String getProduct_id() {
		return product_id;
	}
	public void setProduct_id(String product_id) {
		this.product_id = product_id;
	}
	public String getQuantity() {
		return quantity;
	}
	public void setQuantity(String quantity) {
		this.quantity = quantity;
	}
	public String getSubtract() {
		return subtract;
	}
	public void setSubtract(String subtract) {
		this.subtract = subtract;
	}
	public String getPrice() {
		return price;
	}
	public void setPrice(String price) {
		this.price = price;
	}
	public String getPrefix() {
		return prefix;
	}
	public void setPrefix(String prefix) {
		this.prefix = prefix;
	}
	public String getSort_order() {
		return sort_order;
	}
	public void setSort_order(String sort_order) {
		this.sort_order = sort_order;
	}
	public product_option_value_description getProoptionvaluedescription() {
		String[] arg = {this.product_option_value_id};
		Cursor c = mContext.getContentResolver().query(product_option_value_description.CONTENT_URI, null, "product_option_value_id=?", arg, null);
		while(c.moveToNext()){
			prooptionvaluedescription.setProduct_option_value_id(this.product_option_value_id);
			prooptionvaluedescription.setLanguage_id(String.valueOf(c.getInt(1)));
			prooptionvaluedescription.setProduct_id(String.valueOf(c.getInt(2)));
			prooptionvaluedescription.setName(c.getString(3));
		}
		c.close();
		return prooptionvaluedescription;
	}    
}
